<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>改变this指向</h2>
</body>
<script>
    var username = 'alice'

    const obj = {
        username: 'jack'
    }

    function getName(a, b, c) {
        console.log(this.username, a, b, c) //打印？？？？
    }

    getName.call(obj, 11, 22, 33) //即改变this，也执行了函数
    getName.apply(obj, [11, 22, 33]) //即改变this，也执行了函数
    getName.bind(obj, 11, 22, 33)() //改变this指向，返回函数本身，并不执行函数
</script>

</html>